package com.isasc.demo.pooled.commonpool;

import com.isasc.demo.pooled.mypool.ShareBike;
import org.apache.commons.pool2.impl.GenericObjectPool;

/**
 * @author: ywy
 * @date: 2022-10-17
 * @desc:
 */
public class CommonPoolTest {
    public static void main(String[] args) throws Exception {
        GenericObjectPool<ShareBike> pool = new GenericObjectPool<>(
            new ShareBikeManager()
        );
        ShareBike shareBike = pool.borrowObject();
        System.out.println(shareBike);
        pool.returnObject(shareBike);
        pool.getCreatedCount();
        pool.getNumActive();
        pool.getNumIdle();
    }
}
